<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
  <head>
    <title> rank </title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
    <?php htmlhead(); ?>
  </head>
  
  <body>
    
    <div class="navTool menuborder">
      <div class="panel">
      <form method="post" action="?act=rank_add" name="myform" id="myform" class="myform">
        <dl>
          <dt>阶级名称</dt>
          <dd><input type="text" name="rank_name" value="" /></dd>
        </dl>
        <dl>
          <dt>阶级颜色</dt>
          <dd><input type="text" name="rank_color" value="" /></dd>
        </dl>
        <dl>
          <dt>阶级图片</dt>
          <dd><input type="text" name="rank_pic" value="" /></dd>
        </dl>
        <dl>
          <dt></dt>
          <dd><input type="submit" value="新增" class="btn" /></dd>
        </dl>
      </form>
      </div>
    </div>
    
    <table class="table">
      <thead>
        <tr>
          <th style="width:30px;">图标</th>
          <th style="width:auto;">阶级名称</th>
          <th style="width:136px;">文字颜色</th>
          <th style="width:128px;">操作</th>
        </tr>        
      </thead>
      <tbody>    
      <?php
        foreach($data as $_=>$v) {
          echo('<tr id="'.$v['rank_id'].'">');
          echo('  <td>');
            if($v['rank_pic']) echo('<img src="..'.$v['rank_pic'].'" height="18" />');
          echo('  </td>');
          echo('  <td>');
            if($v['rank_color']) echo('<span style="color:'.$v['rank_color'].';">'.$v['rank_name'].'</span>');
            else echo($v['rank_name']);
          echo('  </td>');
          echo('  <td>'.$v['rank_color'].'　</td>');
          echo('  <td>');
          echo('    <span class="acticon actedit"><a href="?view=rank_edit&id='.$v['rank_id'].'">修改</a></span>');
          echo('    <span class="acticon actrecycle"><a onclick="return confirm(\'确定删除?\');" href="?act=rank_delete&id='.$v['rank_id'].'">删除</a></span>');
          echo('  </td>');
          echo('</tr>');
        }
      ?>
      </tbody>
    </table>

    <script>
      $(document).ready(function(){
        $(".table tr").hover(function() {
          if ($(this).hasClass('trhover'))
            $(this).removeClass('trhover');
          else
            $(this).addClass('trhover');          
        });
      });
    </script>
    
    <script>
    <?php echo getTips(); ?>
    </script>
    
</body>
</html>